package com.hans.scala.converter

/**
 * Created by Juntao.Zhang on 2014/4/14.
 */
object ScalaTest {

  import scala.collection.JavaConverters.mapAsScalaMapConverter

  def test1(m: java.util.Map[Integer, String]): Unit = test2(m.asScala.toMap)

  def test2(m: Map[Integer, String]) = m.foreach {
    case (key: Integer, value: String) => println(key + " " + value)
  }

  def test3(m: Map[Int, String]) = m.foreach {
    case (key: Int, value: String) => println(key + " " + value)
  }

  def test4(i: java.lang.Integer) = {
    println(i)
  }
}
